﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using HF.WorkFlow.Engine;
using HF.Framework;
using HF.Architecture.Data;
using HF.User.Data;
using HF.Framework.Web;

public partial class BasePages_AssignTask : System.Web.UI.Page
{
    string OperatorInstanceId = "";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Request["OperatorInstanceId"] != null)
            OperatorInstanceId = Request["OperatorInstanceId"].ToString();

    }
    protected void btnAssign_Click(object sender, EventArgs e)
    {
        try
        {
            WorkFlowRuntime wf = new WorkFlowRuntime();
            string UserId = User.Identity.Name.ToString();
            string AssignUserId = tbxAssignUserId.Text;
            wf.TaskAssign(UserId, AssignUserId, OperatorInstanceId);
            WorkDialog.ShowMessage(this, "指派成功!");
        }
        catch
        {
            throw;
        }
        

    }
    protected void btnCheck_Click(object sender, EventArgs e)
    {
        lbUserName.Text = UserData.GetInstance().GetUserNameById(tbxAssignUserId.Text);
    }
    protected void btnCancel_Click(object sender, EventArgs e)
    {
        this.Response.Write("<script language='javascript'>window.close()</script>");
    }
}
